<?php

namespace App\Admin\Controllers;
use Illuminate\Support\Facades\DB;

class Dashboard
{
    /**
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
     */
    public static function lists()
    {
  	    $list=[
  	    		["key"=>"注册用户:","value"=>DB::table("user")->count('id')],
  	    		["key"=>"发放优惠券张数:","value"=>DB::table("user_tickets")->count('id')],
  	    		["key"=>"食品库数量:","value"=>DB::table("foods")->count('id')],
  	    		["key"=>"登录次数:","value"=>DB::table("admin_operation_log")->where('path','=','admin/auth/login')->count('id')],
  	    	  ];
        return view('home.home',compact('list'));
    }
}
